package com.compiler.lexico;

import java.io.IOException;
import java.io.RandomAccessFile;

import com.compiler.lexico.action.AbstractAction;

public class Transaction {
	private AbstractAction actions;
	private State nextState;
	
	public Transaction(State nextState, AbstractAction actions) {
		this.nextState = nextState;
		this.actions = actions;
	}
	
	public void exec(RandomAccessFile raf) throws IOException {
		this.actions.exec(raf);
	}
	
	public State getNextState() { return this.nextState; }
	
	public String toString() {
		return this.nextState.getName()+"["+this.actions+"]";
	}

}
